<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://www.backbase.com/bjs/core" prefix="bjs"%>

<f:subview id="loginview">
	<bjs:view>
		<bjs:modal id="loginDialog" show="true" binding="#{controller.loginDialog}" style="text-align: center" actionListener="#{controller.loginDialogAction}">
			<f:facet name="header">
				<bjs:outputText value="DIAMONDS Platform Login" />
			</f:facet>
			<bjs:detailViewer style="margin: 0px auto; clear: both; margin-top: 20px">
				<bjs:propertyItem itemLabel="Username">
					<bjs:inputText id="username" value="#{user.name}" style="width:100%"/>
				</bjs:propertyItem>
				<bjs:propertyItem itemLabel="Password">
					<bjs:inputSecret id="password" value="#{user.password}" style="width:100%">
						<f:validateLength minimum="4" />
					</bjs:inputSecret>
				</bjs:propertyItem>
			</bjs:detailViewer>

			<bjs:message for="password" errorStyle="color:red" />
			<bjs:commandButton style="padding:15px" value="Login" actionListener="#{login.doLogin}" />

			<bjs:box show="#{user.authError!=null}">
				<bjs:outputText style="color:red" value="#{user.authError}" />
			</bjs:box>
		</bjs:modal>
	</bjs:view>
</f:subview>
